package com.boot.learning.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.boot.learning.dao.SimpleUserMongoDao;
import com.boot.learning.domain.SimpleUserMongo;

/**
 * 用户业务实现(Mongo)
 * 
 * @since JDK1.8
 * @author vencano
 * @date 2017年1月18日 下午8:01:54
 */
@Service
public class SimpleUserMongoService {

	@Autowired
	private SimpleUserMongoDao simpleUserMongoDao;

	public List<SimpleUserMongo> findAll() {
		return  simpleUserMongoDao.findAll();
	}

	public SimpleUserMongo registerOne(SimpleUserMongo simpleUser) {
		return simpleUserMongoDao.save(simpleUser);
	}

	public List<SimpleUserMongo> registerBatch(List<SimpleUserMongo> simpleUsers) {
		return simpleUserMongoDao.save(simpleUsers);
	}
}
